package text.ui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;

import javax.swing.JPanel;
import javax.swing.border.LineBorder;

public class DefaultMode extends Viewer {

	private JPanel contentPane;
	
    /**
     * main method allows us to run as a standalone demo.
     */
    public static void main(String[] args) {
		DefaultMode defaultMode = new DefaultMode();
		defaultMode.init();
    }
    
    /**
     * DefaultMode Constructor
     */
    public DefaultMode() {
        // Set the title for this demo, and an icon used to represent this
        // demo inside the GUI app.
        super(null, "DefaultMode", null);
        createPanel();
    }

	private void createPanel() {
		contentPane = createContentPane();
		getViewerPanel().add(contentPane, BorderLayout.CENTER);
		getViewerPanel().setBorder(new LineBorder(Color.GRAY, 1));
	}
	
	private JPanel createContentPane() {
		return new JPanel(null) {
			protected void paintComponent(Graphics g) {
				super.paintComponent(g);
				
				Color cLightGray = new Color(240, 240, 240);//gray
				Color cDarkGreen = new Color(10, 118, 13);//green
				Font labelFont = new Font("Dialog", Font.BOLD, 12);
				
				int w = getWidth();

				Color origC = g.getColor();
				Font origF = g.getFont();

				g.setColor(Color.WHITE);
				g.fillRect(0, 0, w, getHeight());

				g.setColor(cLightGray);
				g.fillRect(0, 0, w, 48);
				g.setColor(cDarkGreen);
				g.fillRect(0, 48, w, 24);

				g.setColor(Color.WHITE);
				g.setFont(labelFont);
				g.drawString("Welcome to TExt Translation!", 12, 65);
				g.setColor(Color.BLACK);
				g.drawString("To start, please select a mode either in the Menubar or in the Toolbar.", 12, 140);
				g.drawString("There are two modes to be selected:", 12, 175);
				g.drawString("Training Mode: This allows you to train the system with your own corpora.", 50, 200);
				g.drawString("Translation Mode: This allows you to translate your file.", 50, 225);

				g.setFont(origF);
				g.setColor(origC);
			}
		};
	}
}